import { post, get, _delete, put } from '@/lin/plugin/axios'

class Gateway {
  static async addGateway(data) {
    const res = await post('v1/Bgateway', data)
    return res
  }

  static async getDetail(id) {
    const res = await get(`v1/Bgateway/${id}`)
    return res
  }

  static async editGateway(id, data) {
    const res = await put(`v1/Bgateway/${id}`, data)
    return res
  }

  static async deleteGateway(id) {
    const res = await _delete(`v1/Bgateway/${id}`)
    return res
  }

  static async getGateways(page = 0, count = 10) {
    const res = await get('v1/Bgateway/page', { page, count })
    return res
  }

  static async search({keyword,page,count}){
    const res = await get('v1/Bgateway/search',{
      keyword,
      page,
      count
    })
    return res
  }
  
}

export default Gateway
